
import 'package:coinbaby/common/const/cosnt.dart';
import 'package:coinbaby/common/textstyle/textstyle.dart';
import 'package:flutter/material.dart';

class HomeSortView extends StatelessWidget {

  static const List<String> titles = ['币种', '最新价', '24H涨跌'];

  List<Widget> _create() {
    return titles.map((e) {
      return Flexible(
        flex: 1,
        child: Row(
          mainAxisAlignment: titles.indexOf(e) > 0 ? MainAxisAlignment.end : MainAxisAlignment.start,
          children: <Widget>[
            Text(e, style: AppFont.textStyle(14, AppColor.fontgrey),),
            SizedBox(width: 5,),
            Image.asset("assets/sort.png")
          ],
        ),
      );
    }).toList();
  }
  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.all(15.0),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: _create(),
      ),
    );
  }
}